import type { VabRouteRecord } from '/#/router'
import Layout from '@vab/layouts/index.vue'

export const salesmanRouter: VabRouteRecord = {
  path: '/salesman',
  name: 'salesman',
  component: Layout,
  meta: {
    title: '业务员管理',
    icon: 'book-read-fill',
    guard: {
      //2021年9月份新版本，当config/settings.js中rolesControl配置开启时，用于控制角色（全写）
      role: ['salesmanListView'],
      mode: 'oneOf', //allOf: 数组内所有角色都拥有，返回True oneOf: 数组内拥有任一角色，返回True(等价第1种数据) except: 不拥有数组内任一角色，返回True(取反)
    },
  },
  children: [
    {
      path: 'salesmanList',
      name: 'salesmanList',
      component: () => import('@/views/salesman/salesmanList.vue'),
      meta: {
        title: '业务员提成',
        guard: {
          role: ['salesmanListView'],
        },
      },
    }
  ],
}
